{% extends "base.html" %}
{% block main %}

<script>

</script>

<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <h1>快递管理</h1>
        </div>
    </div>
</div>

<div class="container">
    <div class="row clearfix">
        <div class="col-md-4 column">
            <form class="form-inline">
                <label for="deliveryInput"></label>
                <input type="text" class="form-control" id="deliveryInput" placeholder="输入单号">
                <button id="deliveryInputBtn" class="btn btn-default">入库</button>
            </form>
        </div>
        <div class="col-md-4 column">
            <form class="form-inline">
                <label for="deliveryOutput"></label>
                <input type="text" class="form-control" id="deliveryOutput" placeholder="输入单号">
                <button id="deliveryOutputBtn" class="btn btn-default">出库</button>
            </form>
        </div>     
    </div>
</div>

<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <br/>

            <table class="table" id="DeliveryTable">
                <thead>
                    <tr>
                        <th>编号</th>
                        <th>单号</th>
                        <th>状态</th>
                        <th>日期</th>
                        <th>备注</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                     {% for delivery in deliveryData %}
                    <tr class="{% if delivery.state=="INBASE" %}success{% endif %} {% if delivery.state=="OUTBASE" %}active{% endif %} {% if delivery.state=="RETURN" %}warning{% endif %}">
                        <td>{{ delivery.showId }}</td>
                        <td class="delivery-name">{{ delivery.deliveryName }}</td>
                        <td>{% if delivery.state=="INBASE" %}已入库{% endif %} {% if delivery.state=="OUTBASE" %}已出库{% endif %} {% if delivery.state=="RETURN" %}已退回{% endif %}</td>
                        <td>{{ delivery.createdAt }}</td>
                        <td>
                            <form class="form-inline">
                                <label for="deliveryInfo"></label>
                                <input type="text" class="form-control input-info" placeholder="{{ delivery.info }}" value="{{ delivery.info }}">
                                <button class="btn btn-default btn-info btn-update-info">修改</button>
                            </form>
                        </td>
                        <td>
                            <button class="btn btn-success btn-out" {% if delivery.state=="OUTBASE" %}disabled="disabled"{% endif %} {% if delivery.state=="RETURN" %}disabled="disabled"{% endif %} >签收</button>
                            <button class="btn btn-warning btn-return" {% if delivery.state=="OUTBASE" %}disabled="disabled"{% endif %} {% if delivery.state=="RETURN" %}disabled="disabled"{% endif %} >退回</button>
                            <button class="btn btn-danger btn-delete">删除</button>
                        </td>
                    </tr>
                    {% endfor %}

                </tbody>
            </table>
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <!-- 前一页 -->
                     {% if ui.pagination.currentPage==1 %}
                    <li class="disabled">
                        <span>
                            <span aria-hidden="true">&laquo;</span>
                        </span>
                    </li>
                    {% endif %}
                     {% if ui.pagination.currentPage != 1 %}
                    <li>
                        <a href="{{ " /?page="+(ui.pagination.currentPage-1) }}" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                    {% endif %}

                    <!-- tabs -->
                    {% for pageTab in ui.pagination.pageTabs %}
                    <li class="{% if ui.pagination.currentPage === pageTab.pageNum %}active{% endif %}" ><a href="{{ pageTab.url }}">{{ pageTab.pageNum }}</a></li>
                    {% endfor %}
                    
                    <!-- 后一页 -->
                     {% if ui.pagination.currentPage===ui.pagination.totalPage %}
                    <li class="disabled">
                        <span>
                            <span aria-hidden="true">&raquo;</span>
                        </span>
                    </li>
                    {% endif %} {% if ui.pagination.currentPage != ui.pagination.totalPage %}
                    <li>
                    <a href="{{ "/?page="+(ui.pagination.currentPage+1) }}" aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                    </li>
                    {% endif %}

                                        
                </ul>
            </nav>
        </div>
    </div>
</div>



{% endblock %}